Separate utility functions from i9s.py to utilib.py

Add sendemail() to utilib.py