Properly generates task 1, bug fixes

There were a lot of bugs in the implementation of some methods, but
let's not go into that. They're fixed now.

This properly creates the tables with support for unlimited parents and
nodes, using an awesome recursive function. I think one of the old
methods is no longer needed so I may delete it.