Refactoring with tests in mind

I was too late to comment on @lnielsen-cern's pull request, so I've made the changes directly.

* printed errors are going to stderr
* using `format()` instead of `%` as recommended
* `subprocess.Popen` instead of `os.system` (because I like my stdout/stderr clean)
* factoring stuff out (to ease the tests)
* using file mock to test `prepare-commit-msg`
* some utf-8 :heart: for people with non ASCII names (like Jiří Kunčar)
* `six` is not required anymore