Fixed the dumping of migration code by escaping PHP strings properly

Fixes #183