Fixes to compile with clang
Speed up compilation time for luafunctions
* Other compile fixes for gcc