Test improvements and other stuff

This includes a bunch of general fixes as well as a reorganization of the unit testing "suite". It breaks compatibility of the interface for detecting response to sending statements (in so far as there was almost no interface before, and what there was was broken). So it should be safe to assume it hasn't been leveraged.

Unit tests pass in Chrome 25, IE 9, FF 18, Safari 6.0.2 when run against Cloud.

Issues covered #21, #18, #16, #14