Massive gui refactor + other misc tweaks