Initial christmas release import

Parts of this code is a actually a few years old, and I'm not 100% sure
I've cleaned it up in a way that I originally intended. But this is now
so here we go.