Slight improvement of documentation of the document API and added
(extremely rudimentary) JUnit test for template system.