moved input event handlers and logic into device namespace. Added super basic example.