Restructured code, added JSON configuration support, and updated cube map example.