Version0.2.x

Rewrite most of the code, make it more modular and increase the testing coverage.