Adding underlying bits to support delegates
Minor cleanups
Invoke all the delegate callbacks
Adding basic delegate tests