refactor code on main controller

merge twilio work into master. texting works