create module and extend by all class

Hi,

I wrapped methods at lib/mgem as module for extend by others, and make mruby_dir changeable.