Fix documentation links to reference correct line numbers. Refactor documentation html template into file.