Make some changes in an attempt to speed up the database.

That probably did not help.
Import yoboard.config into the flask configuration.
Optimize some stuff for code length.
Properly handle removal of attached threads.