dataaccess: Restructure method ordering and placement.

Move abstract methods into interfaces and synchronize positioning
between files.
dataaccess: Cleanup and compress query generating methods.