Some secure apdu stuff, and some trash to get inbuffer applets working