Convert keyboard and mouse back-ends
- Use base classes
- Use function-style factory