Cleanup reflection.js.

This is in preparation for some more work I'd like to do here, but that might take a while still.