Some optimizations and tweaks in support of Shared Canvas

The main things are:
* allow setTimeout to be avoided almost always (better performance in some browsers)
* allow multiple instances of a value as the object in a (s,p,o) set of triples (this is necessary when the 'o' in (s,p,o) is an array that may have duplicates)