Thanks Pylon! That makes complete sense. I'll work on refactoring that code right now! I believe that will fix the web server not responding issue.
I'm still worried about the display not fully working though, so I guess that will be next to investigate after this...