makes generateToken accept an array of options, fixes #20