Group if statements to switch statement. Group the dublicate code lines.
Merge pull request #7 from d2rk/speedup-param-module

modules/src/param: use switch instead of chained if; group the duplicate code lines.