Remove hardcoded DB prefix in queries
Introduce locallib for code reuse between rubric and guide

The rubric and guide reports have a lot in common, so much of the code can
be shared between them.
Version bump to RC2