Moved some stuff around, made the IO bits functional. Rotation is
currently broken.