Setup and reorganization

This does a bulk of the initial setup and does a lot of reorganizing as well.