adding support for complex capabilities

fixes #208
fixes #200
fixes #217