Fixed tests, changed organization and dependencies for core