Implementation of type checking functions for JavaScript which wrap around the many inconsistencies in the core langauge.