Small class for handling output of a hierarchical tree using PDO and arrays