Cleaned up beachline code and prepared to move the drawing out of it.