Move toolbar UI code to new JS file