Added some IoC stuff and implemented basic authentication.