Add production/debug configs
Add basic support for serializing an index
Also export those functions