Internal fixes, WIP
Documentation
Rewrite internals, enable cover, fix dialyzer
Whitespace
Add doc target and some minor doc cleanups
Minor doc fix
Tidy up middleware