Tidied up distribution API

Pass parsed versions rather than strings.
Made ~id argument optional.