Revert "Revert pull req #36, #37, #38"

This reverts commit 5df4e165214750f25776545389a3cccc0368f615.

@raphink, I revert "Revert pull req #36, #37, #38" on this branch.

And I will test this branch for a while and there will be no problem,
I will release as v0.2.0.

Thanks.