added "VAR.length" search string and cleaned scope

You can now output the "length" property of arrays with the selector
string, eg:  {{VAR.PROP.length}}
Also, I added some missed "var" statements and commas that were
clogging up the window object.