More readable constant names

Useful when debugging the HTML
Refactoring, added datatype as class

Referencing existing attributes is better than repeatedly calculating
the same things.