Fixes for keyboard input typing in the canvas in firefox

Also includes dimming the canvas when it's not focused.

Fixes #21.