Leaving them in can trip up postgresql:
```
Traceback (most recent call last):
File "lib/galaxy/web/framework/decorators.py", line 283, in decorator
rval = func(self, trans, *args, **kwargs)
File "lib/galaxy/webapps/galaxy/api/history_contents.py", line 396, in create
return self.__create_dataset_collection(trans, history, payload, **kwd)
File "lib/galaxy/webapps/galaxy/api/history_contents.py", line 525, in __create_dataset_collection
**create_params
File "lib/galaxy/managers/collections.py", line 108, in create
copy_elements=copy_elements,
File "lib/galaxy/managers/collections.py", line 181, in create_dataset_collection
copy_elements=copy_elements)
File "lib/galaxy/managers/collections.py", line 217, in _element_identifiers_to_elements
copy_elements=copy_elements)
File "lib/galaxy/managers/collections.py", line 389, in __load_elements
copy_elements=copy_elements)
File "lib/galaxy/managers/collections.py", line 434, in __load_element
self.tag_manager.apply_item_tags(user=trans.user, item=element, tags_str=tag_str)
File "lib/galaxy/managers/tags.py", line 182, in apply_item_tags
self.apply_item_tag(user, item, name, value)
File "lib/galaxy/managers/tags.py", line 154, in apply_item_tag
tag = self._get_or_create_tag(lc_name)
File "lib/galaxy/managers/tags.py", line 233, in _get_or_create_tag
tag = self.get_tag_by_name(scrubbed_tag_str)
File "lib/galaxy/managers/tags.py", line 205, in get_tag_by_name
return self.sa_session.query(galaxy.model.Tag).filter_by(name=tag_name.lower()).first()
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2789, in first
ret = list(self[0:1])
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2581, in __getitem__
return list(res)
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2889, in __iter__
return self._execute_and_instances(context)
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2912, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 948, in execute
return meth(self, multiparams, params)
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
context)
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1416, in _handle_dbapi_exception
util.reraise(*exc_info)
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/bioinfo/guests/mvandenb/galaxy/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 507, in do_execute
cursor.execute(statement, parameters)
ValueError: A string literal cannot contain NUL (0x00) characters.
```
This is good for a few reasons
* It speeds up the bottleneck that is the job creation code in the web thread (the job handler is much easier to parallelize). Skipping the flush for all those datasets and skipping the disk write per dataset should really speed things up nicely when submitting large numbers of jobs and jobs with a large number of inputs.
* This prevents a disk slow down from grinding the web response to a halt. We don't want the handler to freeze up either - but if something is going to freeze it is a better user experience and easier to recover from the job handler freezing while their are disk problems.
* This allows per-job-handler object store configurations - simply configure different job handlers with different object store configurations. This is cool and important and I can imagine some awesome applications but I will wait for them to materialize.
When creating thousands of jobs for large database transactions - previously Galaxy would query the database thousands of times for the same history id, user id, and session id.
Needed after 46170e9bcdcc2eb104ebab72a7afc9b7238bc314 to keep galaxy-lib from importing things outside of galaxy-lib but clearly a good refactoring on its own since it eliminates mid-file imports that were there to prevent circular dependencies from loading Galaxy.
Fix 1 error and 2 failures in unit tests under Python 3, e.g.:
```
FAIL: test_render (unit.visualizations.plugins.test_VisualizationPlugin.VisualizationsPlugin_TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/galaxyproject/galaxy/test/unit/visualizations/plugins/test_VisualizationPlugin.py", line 180, in test_render
self.assertIsInstance(response, string_types)
AssertionError: b'\nTrue\n' is not an instance of (<class 'str'>,)
```