Added lua parser script, also fixed some small error handling issues in webgl device