Generating queries model and controller. Instead of using usernames for authentication, sorcery now finds 'thandle's.