Refactoring quantization

This commit makes quantization parameters explicit, next step is
to add them to the API.

See #48