Move nested functions out of scrypt and add __all__