Added encapsulation, buttons, and action events

I did precisely what the summary says. Additionally added console
printouts to make sure the action events were behaving correctly.