Fix the test data resource path
Don't return a default database name for a queryrecord
Standardize the systemname before creating a messaging context
Remove unused imports