mKR serializer - single commit

This is a single commit version of
  https://github.com/dajobe/raptor/pull/17
authored by Richard H. McCullough with file permissions changes and line feed changes reverted.