Translation to type class based approach with associated types

- Direct translation from previous approach to the type class based
  approach using associated types (TypeFamilies)
- Refactoring

Not done:
- Interpreter
- Proxies
- Other index/doctable implementations
Add 'jsonPretty' which requires scotty 0.5