added automatic dependency resolving with reflection.
added more tests.