flatten driver functions using promise then() chaining. Also fix memory leak by removing usage of jscrollpane.