Refactored and revised the whole module.

Did so much… can't even comment everything. It's a complete revision.
Bumped version number.