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