templatefilters: add new stripdir filter
Adds a new template filter for removing directory levels from a
string. Examples:
{foo|stripdir} -> 'foo'
{foo/bar|stripdir} -> 'foo'
{foo/bar/more|stripdir} -> 'foo/bar'
{foo/bar/more|stripdir|stripdir} -> 'foo'