Leverage generics to remove the extra heap allocation for the response handlers using Dao's. Also moved some of the environment variables to app state to allow for easier testing.
Moved test helper code to its own module.