Extract SolrRepository class to handle communication with Solr [NO MERGE]

Not for merging yet. It's either for 6.0, or needs some work to make backwards compatible.