Only write the declared phases to file

Only the phases that are specified in the input deck should be written.
Hence the class should work with both two- and three-phase simulations.
Accomodate older versions of boost::filesystem

The return type of the path methods has changed in newer version of
Boost; by wrapping them with a new path object we can get a string
in a way that is compatible for both version 2 and 3.

Hat tip: @bska