Minor refactoring. Moved QueryBody to its own package. Removed stupid db package.