Added test-cases. Improved tests by automatically calling setup- and tear_down-functions for each test. Fixed some cd-functionality.