add debug mode and threejs-stats support