Set versions on plugins properly.

This makes the plugins include their version in the output file
name, and when used as a dependency.

Also create a dist-versioned directory which accumulates versioned
plugins.