templating out tool html and hooking up ajax things