Replace C-style casts with C++-style casts everywhere
Remove unnecessary if-statement
Add Lua function Item.hasAttribute
Use pushBoolean instead of lua_pushboolean