Refactor ComparableQuantity

Keep compatibility between ComparableQuantity and Quantity, creates test to guarantee this compatibility.
Refactor and more documentation.