move DefaultSerializer to a separate file, add tests

Nothing was changed in DefaultSerializer. It was simply moved to a separate file.