Initial commit.
Incredibly basic skeleton in place.
Added some more boilerplate.

I'm going to try to modularize the app more so I can expose more of the underlying functionality to
testing. The main package - client - should only expose a few functions for starting/stopping a
torrent.
Changed my plans for code structure, added tests.

Wrote some simple tests for torrent parsing and tracker announces.
There could be a lot more testing there but I just wanted something
to start with at least.

Decided to go along the route of making the functions in client public.
It seems to me that I benefit by having things more visible for
testing. In order to have things nice though, I've decided to move
functions like Start, Stop, etc. to main and implement them there.
I'm pretty happy with this direction so far.
Still going...

Added a bit to the main executable. Little curious how this organization will turn out... worst case
I'll refactor later I guess.
Starting to have a better hold of the structure.

I'm making some progress on how things are laid out. I'm mostly
satisfied but worried about the heirarchy with the Client and Torrent
structs. One thing I think I should do is have NewTorrent call Parse
inherently.
Simple tracker request works.

Things aren't very robust. I'm really not happy with the design here.
Maybe I need to spend more time thinking about how to organize things.
At least an announce request works now!
More refactoring!

Changed the client package name to torrent. Decided to keep the client
related code in the main package and just have torrent implement all
functionality related to communicating with trackers/peers.
Added test for GetAnnounceURL.

I'm changing Announce to a generic method of the package and
GetAnnounceURL to a specific method of Torrent. Makes more sense to me
that way and also makes it easier to test.
Added some peer stuff.

Peer connections and handshakes are in + tests.
Added code for retrieving peer addresses.

Peer addresses can now be recovered from the compact tracker response
+ tests.
Sending/Parsing peer messages implemented + tests.

Can now construct a Message and send it over a connection. Similarly,
we can take a byte array and produce a Message if it is able to be
parsed. Added some simple tests to verify that things are being parsed
correctly. I think everything is ready to start torrenting :)
Besides file stuff of course... but I think I'll implement that in the
main package instead of in the client.
Framework for connecting to peers in place.

I think the system for connecting to peers is correct... I'm a little
worried that ignoring safe exits in this program is shortsighted and
will cause problems in the future, but I'm deciding to forego that as
this is a simple exercise and a command line program. Next up is
putting keep alive messages in.
Making inroads in reading messages.

Realized that a ton of messages were getting clumped together because
of how TCP works... Wrote a few lines of code that allows the torrent
library to read individual peer messages by splitting using the 4 byte
length that prefixes every message. It works! Gonna start cleaning some
code up now but things look good :)
Some error handling.

We'll reject connections that send packets with enormous lengths, and
also torrents in multi-file mode for now, as we don't support it yet.
Keep-alive functionality is in.

The client will now send keep-alive messages to peers if it hasn't sent
a message in some time, and will also close connections to peers that
it hasn't received a message for in some time.
Sending bitsets.

Maintenance commit. Wrote a basic package for doing bitsets.
Maintenance commit.
Can download whole pieces + mulithreading works!

Things are looking real good. I can connect to multiple peers
simultaneously and download pieces from them. Still a lot of work to do
but I'm not far from getting a whole torrent down!
Definitely need to start cleaning up though; things are real messy.
Fixed a bunch of issues in the tcp connection reading. Turns out that
1. I wasn't reading the correct number of bytes half the time.
2. The buffered reader was eating bytes up from the next read.
Changed timeout...