Add generateRegistrationJs option. See README changes for details.