move most toPTree() methods of PDAL objects out to static functions in PDALUtils.hpp #422
clean up typo #422
add missing include
Merge pull request #422 from PDAL/issues/422-toJSON-toPTree

toJSON and toPTree methods of Metadata (and others) should be in PDALUtils.hpp, not inside class implementations