Fix pkg-config's Lua's version constraint

Constraints need to be properly spaced.
Fix printf-related warnings
Fix a call to luaL_error()
Remove an ill-formed typedef
Fix some cast-related warnings
Fix signedness-related warnings and reorganize headers
Merge pull request #3 from nox/cleanup

Cleanup of various bugs and warnings