Dedupe and canonicalize dependencies; fix #32