added timeout option

We needed to be able to set a socket timeout for communicating with solr.

Also ended up stripping whitespace from the end of some lines.