allow for TEMPLATE_DIRS with or without trailing slashes