completely refactored for better abstraction via a transaction layer, better test methods and defaults, and using the new Plack test interface