Cleanup import in segments.common:

- move `import re` to top
- if import is in a `try` block and there is some processing before it and
  `except` move this to `else`.
Merge branch 'common-imports' into develop
Fix non-ASCII directories processing

Fixes #788
Merge branch 'fix-788' into develop
Home may be None, respect it
Install bazaar with --allow-external
Also use --allow-unverified
Merge pull request #790 from ZyX-I/tests-fix

Fix travis CI build
Added OSX battery support
Refactored OSX battery code
Revert change to segment parameter default value
Update tests to support parameter on _get_capacity()
Merge branch 'osx-battery' into HEAD
Merge branch 'develop' into local-develop