toolbox backend mostly working.  This is a huge refactor of Koushik's code.