Refactoring lots of icekey specific code in icekey-app