Provide a test suite for simple and preflight requests

This also adds integration with Travis CI for running the tests.

The test cases themselves could do with some simplification, but this should cover the core cases.