arbitrary type support (e.g., LuaJIT's cdata)

* arbitrary type support (e.g., LuaJIT's cdata)
* minor refactor