create module and extend by all class

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