Fix for Joyent tests: BouncyCastle initialisation should happen a bit earlier. Also some clean-up.