make stateful object for shared code between config and vm classes
Merge pull request #22 from dataxu/dev-stateful

make stateful object for shared code between config and vm classes