mKR serializer - single commit

This is a single commit version of
  https://github.com/dajobe/raptor/pull/17
with file permissions changes and line feed changes reverted.
Merge pull request #18 from dajobe/mkr-serializer

mKR serializer - single commit