Factor out dotted split

We might want ``failure_format_string`` or similar instead of ``template`` which has a specific meaning in django