Tidy and optimize queries

- kill deprecated Query.manual and replace uses with Query.auto
- massive dead code removal!
- use managed sources to generate repetitive code
- optimize the handling of collections returned from Datomic