upgrade to lua52 (breaking change lua_len() call), add tests