Finish db package refactor.
Refactor query/mapper package.
Refactor query/reducer package.