Convert most AnyObject to Generic <T>

In order to not lose type information many methods have been changed
to use generics instead of AnyObject.
Merge pull request #30 from zolrath/genericism

Convert most AnyObject to Generic <T>