Many improvements, and fixes.

Hey @confuser , spent a few hours fixing problems/cleaning stuff up. Hope you enjoy :). This fixes many things from major memory leaks that crash the server (crashed us for 2 days straight) and purely visual things.