Code to save and load licence (not quite working yet - server still seems to reissue the licence). Small clean-up in xkeymap.