merging in iamnoah's optimizations for the isType family of functions, and other references to core prototoypes
(cherry picked from commit 225d795836d86bdc03518faa656f883e34075f3a)