Added tests with additional clean up.

This includes the tests from https://github.com/turn/ttorrent/pull/46, cleaned up to minimize unnecessary changes to existing code, and reformat the test code to match existing project code style.