Typed static queries

I'm opening this PR so we can discuss the current state of the implementation.
OK, we can't. So this should probably be an application.conf inside the testkit subproject.