fix sql statement for performance
Merge pull request #1603 from marcel-blonk/PLFM-3099

fix sql statement for performance
add sort fields to query object
Merge pull request #1605 from marcel-blonk/PLFM-3071

add sort fields to query object
move metadata to service
Merge pull request #1606 from marcel-blonk/PLFM-3071

move metadata to service
take out foreign key that causes undue locking of user table
Merge pull request #1607 from marcel-blonk/PLFM-3060

take out foreign key that causes undue locking of user table
Merge remote-tracking branch 'upstream/develop' into release-67