Implemented bookkeeping for keyboard and button states, and exposed is_key_down and is_button_down.