Added tests for the query history.

Also tidied up some other tests a bit.
Moved XML reading to separate test.

This makes sense as it has different set-up requirements to the other
tests in ProfileManagerTest, and thus lead to more complicated test
running logic.
Fixed a bunch of code-gen tests.
Merge branch 'emma' of github.com:intermine/intermine into emma