Add a template stack implementation
Record parsing idea in comments