Add tests

I like to see your tests from turn/ttorrent#46 get merged, but I imagine some of the delay might be from a mismatch in code style due in large part to (I assume editor) tab configuration.  I've rolled back the addition of idea project files to reduce noise and reformatted things to match the upstream code style.  You can see the extent of the non-idea, non-whitespace changes here https://github.com/pwoodworth/ttorrent/commit/2aea9df86d303d44b919326c672a809e60e7c0f3?w=1

I'm submitting to your branch so these changes will show up in your original PR request.  If you'd prefer I could instead just submit my branch directly to turn/ttorrent in a new PR.