Use torrent name before torrent filename
Add default bitfield for new peerstates
Merge pull request #28 from rakoo/torrent-name

Use torrent name before torrent filename
Merge pull request #29 from rakoo/fix-default-bitfield

Add default bitfield for new peerstates
Guard against malformed paths.
Open files at read/write time only
Merge pull request #31 from rakoo/lazy-open

Open files at read/write time only
Fix cases when peers send BITFIELD

BITFIELD can be received, but only as a first message or after
an EXTENSION message.
Replace hardcoded ints with consts
Fix misc errors

- The readHeader was returning the full header, including the
  "Bittorrent Protocol" string and its length prefix, but callers
  were considering this string was removed. Removed this string from
  the returned byte slice

- In a for loop, use break to exit the loop rather than a goto

- Make trackerLessMode a per-torrent variable

- If the metainfo has no trackers, set trackerLessMode to true

- Use global consts for message names rather than hard-coded ints

- Remove header parsing in DoMessage, since it has already been done
  before in AddPeer

- Send BitField if remote peer doesn't do extensions

- Don't send choke as first message, rather send it after successful
  BitField

- When last piece fills a full piece, lastPiecLength ==
  STANDARD_BLOCK_LENGTH
Merge pull request #32 from rakoo/misc-fixes

Misc fixes
Fix build issue.

(That will teach me to accept pull requests without building. :-) )
Fix "go test"
Unchoke remote peer after receiving an INTERESTED

This is needed for peers like Transmission who don't send a BITFIELD, so
we don't unchoke them and they don't send REQUESTs, making the transfer
stuck.
Merge pull request #35 from rakoo/fix-unchoke-after-interested

Unchoke remote peer after receiving an INTERESTED