General cleanup

Mostly just consistency, tests cleanup, removal of unused constants.
Nothing crazy.