Split optional dependencies and test dependencies