Big reshuffle of codebase, added plenty of bits.