move key saving to function, fix some more quoting, fix uid detection, fix function arguments
quoting fixes
keyring signing