replaced base var with prototype, so that usage is more natural. also removed define alias.
add inherit method and modify extend method internal workflow. API same