refactored the keyboard.js module a bit...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
some tweaking and cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>