Move isFree from test to main
Only one return from function makes it easier to debug
Add getEmailAsMap
Add test of asMap