Got basic dependency stuff implemented but there are still some bugs

The tests catch the issue.