added bitfield.Bitfield type
Added return to all functions so it works on go 1.My mistake
added file writer
started working on full file downloading
Changed to previous peer comm. Added byte parsing in dowloader.
Solved some bugs , corrected the function that gets our next piece to download, and added downloader states
Modified the way that download starts. Peers now they dont have to wait for each other, when a peer is ready he will start to download. Also added recconect when peer resets his connection.
Now download runs correctly until finish. Also renamed some variables
Solved some memory leaks , added tracker requests while downloading , so we get more peers
Fixed some code at the peers / download speed
Removed some unnecesary go routines at peer. It should run faster
Several code fixes: changed piecesDownloading into a bit field and changed the download status print to output only once a second
Added piece manager , and we request now more efficiently
Greatly increased download speed. Also renamed and moved some functions
Added tracker response so we can see the response from tracker nicely
Refactored the code a lot, it's much easier to read and also the implementation is better. Removed useless code but still much to be done. Gofmt-ed and Govet-ed the peer.go