Added test suite for dependencies
Extended dependencies test suite
Fix problem that dependencies are sometimes stored twice
fixed a problem that led to dependencies not being removed when they should