Clean up package hierarchy.
Extract interface for record store.
Remove some unused code.
Minor cleanups.