adds all of index code, templates, loads libraries