Added master key generation, named all closures for better stack traces