templates: moved element initialization to a proper method
templates: only generate the output if dest is given (support multiple formats/designs)
template: fixed page number (restart when load new elements)