Finished writing the persistent data code. Rearranged some layouts to be more consistent.