Fixed to avoid calling session_start() multiple times.
Added Templater class and updated view to use.