Updated to new core, cut out junk code and moved things that should be elsewhere.