Refactored the debug overlay into its own class.