Huge overhaul

Too many updates to mention, will explain to main developers.