Micro-fixes
Merge pull request #65 from gem/io-weights

Move the calculation of input/output weights into commonlib
Merge https://github.com/gem/oq-commonlib into merge-commonlib