Functional Tests

Adds functional tests and makes a couple api fixes (to get the tests to pass).

Would love a review on this before we merge. Its kinda big (though mostly just new tests).

These will be really useful for running against alternative request handlers (like memcached) to make sure they work.

There are some pending tests here that anyone could fill in if they had time. A few I couldn't figure out and a few I was just lazy on :)