Added button controller, moved controller code from buttonbar to buttoncontroller