Push objects into a hash table to avoid unwanted garbage collection

Also tidy up the collection/where/order methods in preperation for
adding scope chains.