Fix build fail on missing clock_gettime() on Wheezy (at least) 7.2 32-bit, and probably openSuse 12.2 and others.

Note: this is not using configure/automake or cmake or similar so I am unsure of the 'best' way to take into account distro idiosyncracies in this case. Tested on Wheezy 32-bit, and I know from recent experience after upgrading 11.4 --> 12.2 that -lrt is needed on Opensuse (for at least 64bit) as well.
Also fix librt reference in test harnesses
Update .gitignore.

Based on patch by Andrew McDonnell <bugs@andrewmcdonnell.net>

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Update for new ccan/time.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
packet: fix classic realloc bug.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rewrite network protocol (UNFINISHED)
packet: make more typesafe, fix bug.

I knew this would happen.  Am lazy...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
More work on actually getting it to work.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Make number of shards variable.

It's not very deep in the protocol, and this allows us to put the shard
offsets inside the header.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>