Moves everything except module table out of core module for #79.
Merges conflicts with branch issue79 for #79.
Modifies key_data and adds key_data_alter #79.