Clean up, document, and test new constant code