Fix concurrency issues in solr

Also add more documentation, tests, add @SuppressWarnings when needed