Keyboard update to use rows and cols rather than hard coded values

Keyboard currently takes cols and rows as part of its constructor but does not take these into account when building the grid of buttons.  I've added support for this and tests around the change.

There are also some additional tests around the rest of the keyboard functionality as there were no existing tests for this file.