Functional test part1

This rolls back #259 (otherwise inserts fail) and can't be merged until #121 is fixed.

This is a first attempt at #106 and only scratches the surface.

Before deep diving into writing all the tests, I wanted to get a feel for how we wanted it to look.

@silvolu this will require setting some environ variables in Travis. Do I have the ability to [change this][1] or should I just use you as a relay?

Also @tseaver and @silvolu this is a good place to decide what we'd like to do with `demo.key`.

[1]: http://docs.travis-ci.com/user/environment-variables/#Using-Settings