Set up Calculation infrastructure and created mode files.
Rearranged mode infrastructure to make it more sensible.