Edit key changes

Comments please!

Changes:
Save existing key logic reworked - complex, but reasonably well tested
Key capability editing by checkboxes
Keys only let you save if they need to
Ask you to save if you make changes and try to go back without saving

Attempt at making the edit key ui fit neatly with the sidebar, like other sections. Does this look OK?