PHP class for manipulating html content and tags