- Refactor Keymanager to backend. Closes #5711.
- Cleanup backend from hacks. Closes #5698.