Added documentation and tests for latest metrics code. Instrumented realignindels.