Added precision-related getters

Created getters hasFinitePrecision, precision and scale.

Also provided tests to verify the workings of the implementation.

I really broke my head on this, just to realize that `toDecimalString()` had part of the implementation already in it. I changed it to use the getters to avoid code duplication.