modrepo: fix memory corruption bug

- also, better interface for enumerating available modules
pushed version to 0.31b
Merge branch 'master' into release