Massive improvements:
1. Added Cython module;
2. Added an abstraction for IO instead of std streams;
3. Some refactoring.