[coordinate.js] Refactored precision texts handling and added tests

Some refactoring of the precision text handling coming along with some corresponding tests.

Change-Id: Ic1705275898303a9c69f0782d18407c3657f87ab