Quoting @ssastry from IRC,
we need to spec a PHP interface that will serve as an entry point into the Parsoid-PHP composer lib. integration and api code in mediawiki core will be written against this interface. loosely, the implementation of this interface will be what you've already done with lib/parse.js and lib/FromHTML.js ... but will probably look a little different.
@cscott adds,
probably review the phab task for dependency injection. the constructor or entry point should probably take an abstract object for Env, I think that's the point at which all our "dependencies are injected"