Order imports.
Cleaned up docstrings, fixed typos.
Rename variables to be more meaningful / consistent.
PEP8
Remove redundant component lookup.
Merge pull request #256 from 4teamwork/lg-refactor-document-from-template

Refactor "document from template" view