Load all CM dependencies at once, fixes #337 and #336