Major refactoring, new features

* handle SSL throughout
* standardise encoding headers of all files
* add "die on error" option
* add TODO items
* minor comment reformatting
* remove use of "unicode_literals" and unicode in general, with
  explanation
* general refactoring
* make default host-string consistent with IP version
  (::1, 127.0.0.1)
* add tests
* rename some flags in TODO
* version bump