Fix for NSData attributes (and more)

Fix for NSDate attributes
Fix for sqlite reserved word attributes
Added support for GROUP BY and aggregate queries
Added support for SUBQUERY
Added support for chained, related attributes and other JOINS