Add support for optional dependencies