Fixed an epsilon related terrain collapse issue. Added a debug class with optional debug level and a compile time off switch