Refactored scale widget into separate class.
Also reworked keydown handling to be added directly to document rather than the div as this was creating multiple
problems.