Also recognize --iknowwhatimdoing when running as daemon

Fixes #337
Bugfix: Do not run gcode analyzer when a print is ongoing

Evaluate active flag on gcode analyzer AFTER fetching an item from the work queue, otherwise it will always start working once it finds something if the active flag was true once but then switched to false while the queue was still empty.  Thanks to @Salandora for spotting this.

Fixes #357

(manually cherry-picked from 592f3dc)
Extracted all used regexes in the comm layer and precompiled them

Possible improvement of #390
Hopefully fixed a race condition that could occur when pressing "Print" (file not opened yet, but comm layer tries to fetch next command)

Possible fix for #400
Merge branch 'master' into staging

Conflicts:
	run
	src/octoprint/util/comm.py