Implemented per-key handlers. Closes #44