Simplify PTree & PNode interface. Add logging. Cleanup.