Added tests and slightly updated code for convenience

Hello,

I have added some tests (merged from ) for easier development. Your torrent library is way better others we could find, but still misses some features we need. 

So we'd like to continue contributing some features like multi-torrent clients and ability for tracker to accept external (foreign) torrents.

Also, I have setup a CI configuration at http://teamcity.jetbrains.com/project.html?projectId=ttorrent

Thank you,
Sergey