Add a base controller class. Fix #9