Preloader

Some preliminary work, mostly logic though.