Added SQL mode and ability to switch between applications