Retain template and rawdata history

Template and rawdata history is now retained. We no longer bother
exploding rawdata into an array of lines