Define $role variable in User_Command::generate()

This fixes role-setting when generating users.
fix notice in find_item_by_key()
add Behat test for #985
Merge remote-tracking branch 'boonebgorges/master'

closes #985