This commit basically just adds the codes from the PR
https://github.com/micahflee/onionshare/pull/804/commits
on the newly structured and refactored code and also
fixes import dependencies and changed any code that was
relevant with the new code of onionshare