Some misc cleanup
Overhaul for Wai 2.0, take away access to monad internals, beginning of custom error types.