Use Python3.3's ipaddress module http://goo.gl/QW71S
Renaming  MyHandler → RequestHandler