split some method into patches.py

register methods dynamically, unstable
todo:
    unittest
    rename all self to i