add proto method and modify extend method internal workflow. API same
v0.3.2 - first parameter may be an initialize function