Move DatabaseQueryResult into common package and add unit test