Added optional key to initializer so lookups can be done by any key

Removed the need for the users hash to have a kay called 'username', but kept the default behaviour the same