Template renaming now saves correctly. Cleaned up a bit and changed the UI slightly.