#335 Allow template nodes to be passed as a template option

Split the parsing/switching logic of the type of template option
provided into the `template-parser` module and refactored `fragment`
module to only convert string -> document fragment