added tests for utility  functions and moved some utility functions from email_io into utility