BSD/OSX porting and tests
This makes `fdroid init` and `fdroid update` work on BSD/OSX and maybe Cygwin also (I didn't test Cygwin). It also makes the install process more tolerant, like not requiring `python-magic` to run, while using it if its available.
Some fixes and additional tests are also included. The commit messages have more info.
See merge request !56