Reorganize tests and dependencies