added serialization

Added serialization classes to maxwell/serialization. Also added a few comments
to make things easier to read.
src idx uses encoder

The SourceIndex class now uses the Encoder interface to serialize the index of
source files. Looks pretty good, some unit testing is required though.