base: support prototype chains

fix #32