Moved some constants to their own class, other minor tweaks.