Refactored/cleanedup keyboard plugin and controller