Working commit. Get extra selection criteria into match count.
Force author, category, and tag ids to be integers.
More refactoring. Make sure methods have comment block.