Added better support to template loader for paths that don't use slash

Very simple change to make a path canonical (use '/' as separator) before splitting.