Added several tests, getting more stable now, needs refactoring again though...