Minor improvements

Each of the commits in this pull request needs to be viewed by itself and could possibly be seperate requests.
The individual commits themselves provide adequate information on what has been changed.

The primary changes are around reduction of queries to mysql when populating solr

@byxorna