Added unit tests for request and response objects

Tests are based on pytest and mock.
A setup.py is now used to allow tests to import tygs with "python setup.py develop"
Utility functions to handle encodings were added to utils.
core.py and util.py still need testing.
Fixed bugs in the process.
Also added some error handling including some exceptions with explicit error messages to help debugging.