Added support for sub templates and passing template variables via constructor
Added newline constant to use instead of PHP_EOL which in some cases isn't suitable as can change depending on the platform