fix(core, peer) helpers to testutil, err handling

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Merge pull request #419 from jbenet/refactor/peersafe

refactor(peer) some _minor_ safety features
style(net) rm unused error

having an error return value makes the interface a bit confusing to
use. Just ponder... What would an error returned from a predicate
function mean?

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
style(core) signature

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
silence verbose output

for higher SnR at IPFS_LOGGING=info

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
fix(swarm) Dial panic

+/- if len(addresses) is 0, connSetup will be called with nil value for c.
+/- avoid variable reassignment

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
style(logging) demote some statements to Debug (from info)

to improve SnR. Feel free to contest these changes if you find these
statements useful. In my experience, they were adding noise at Info.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
refactor(dht) remove extraneous return value

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
style(peer) shorter ID when printing Peer

feel free to contest/revert if this becomes a problem

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
feat(core) supervise bootstrap connections

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
feat(bootstrap) consider active cxns and connect to subset

* only bootstrap if the number of active connections falls below a given threshold
* when bootstrapping, connect to a subset of peers

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
refactor(bootstrap) reduce interface

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>