Added BF/DF traversing and lots of bug fixes (resolves #1)