Update process mapping calculation routine:
- Fix the bug with plane distribution.
- Make routine distribution agnostic.
- Move it to src/common/mapping.[c/h], so it can be used by several PMI plugins.