Add a Constants class and use it
Some code and test improvements