Rename eraseAttribute to removeAttribute
Code cleanup
Lua cleanup

Move old functions to compat.lua
Remove unused m_realPos in script environment