Some changes & ideas from pull req commit 64185ed1c8f615d21a36f47dc13c5595420a9e09 by nodevel.
Experimental code for setting toolbar position (commented out)