Adds a bugfix to ensure the toolbar is not undefined before accessing it's properties.
Adds missing global declaration to activate.spec.js
Adds more undefined checks to all functions called via setTimeout.

There seems to be a lot more unexpected race conditions if you deactivate the editor from other event handlers.
By checking that properties are defined before accessing these errors should be fixed.
Merge pull request #198 from martinth/issue-197-toolbar-may-be-undefined

Adds a bugfix to ensure the toolbar is not undefined