added functions for extended integer type checking; based enum handling on lua_Integer