More BDD work

Changed the function implementation so that the BDD graph is actually a
separate structure. This should make it easier to manipulate, but also
make it possible in the future to do more efficient garbage collection.

Now using the variable's uniqid value as the root value. Using -1 for
boolean one, and -2 for boolean zero. This detail is a little strange,
but it's nice to have everything implemented as integers.

Also implemented a DFS traversal method.