complete rewrite of tag_expressions.rb