Allow for extensibility in SugarRecord

This allows us to store any class that extends SugarRecord (or multiple
levels of inheritence) into the database.
Fix a few issues with inflating and storing references
Clean up whitespace