Fix #420

simple non-recursive depth first traversal passes existing test and lets
the above example work as well. I don't know if different python objects
can share an _id, so I keep track of those explicitly, like the previous
version.
Merge branch 'master' of github.com:ContinuumIO/bokeh