Added Context Bean to main class

Converted context in main class to a bean to be used by the controller