rewrite of query api and collection mapping

* replaced programmatic construction of queries with a query parser supporting an sql-like query language. this allows easy creation of complex queries with named bind parameters and a uniform offset/limit syntax independent from the underlying database (see the query unit tests for examples). parser grammar is defined in lib/sqlstore/query/parser.pegjs)
* simplified collection mappings: instead of specifying a numer of properties, a mapped collection is now a simple query using the same syntax as for instant queries. properties of the object owning the collection can be referenced using named bind parameter syntax (eg ":id"), but additional bind parameters are supported too

this commit is API incompatible to the 0.1.1 release, most notably:

* store.query() expects the query string as argument, and no longer returns a Query instance but directly the result
* results of property queries are no longer returned as array of values but as array of objects (even if only one property per result row was requested)
* the "aggressive" loading argument is gone, this can be specified in the query string itself (eg. "select User.* from User")
* the Entity.query() method is gone
* collection mapping definition is completely different: a "query" property defining the contents of the collection replaces all former mapping definition properties (with the exception of "partitionSize")
refactored sql query generation, added aliasing of selections and source entities

* ast nodes no longer have a toSql method, instead using a newly introduced SqlGenerator visitor. this makes things cleaner and opens up the possibility to create other ast transformations (most needed is one for debug display of a query ast)
* parser now accepts aliases for selected properties and "from" entities. for property selections the result objects' properties follow the schema "Entity.property" (before just the selected property name was used, which lead to conflicts in queries for eg. "Author.id, Book.id")
allow entity queries using aliases (eg. "select author.* from Author as author")

* introduced new ast node AliasEntity
* split ast getMapping() methods into getEntityMapping/getPropertyMapping to make things more explicit
only return an array of objects if more than one property has been queried for
boost query flexibility

the distinction between entity and property queries is gone, it's now possible to retrieve entities and/or properties in one query. if only one entity/property is queried for, the result is a flat array. if the query contains multiple selections, an array of objects is returned. the property names can be defined in the query using "as [propname]".

all selected columns are now aliased in the final sql statement - this was necessary to allow aggressive storable selection in combination with property/aggregation selections. based on the selectclause in the query's AST a set of jdbc resultset collectors is created (by collectorgenerator visitor). each single collector extracts the values from the resultset and return them or creates the appropriate storable.
dialect addOffset/Limit/Range methods now expect an array as buffer instead of a StringBuffer (simplifies sql generation a bit)
code cleanup

* property mapping's getQualifiedColumnName() now accepts an optional alias which is used as prefix instead of the table name
* refactored mapping to use Object.defineProperties instead of multiple Object.defineProperty calls
* cleaned up sqlgenerator a bit
switched from ringo-storable to own implementation based on it:

* storable now uses states to precisely detect the various stages in the lifecycle of a storable instance (transient, clean, dirty, deleted)
* save() now uses a HashSet instance to track the visited storables in order to handle circular dependencies (before the transaction instance was misused for that purpose too). for this to work transient objects now also get a Key instance (before their _key property was only populated after persisting)
* save() now clears the _props object of the persisted storable - this ensures that mapped objects/collections are freshly populated (esp. with circular dependencies that's vital), plus it spares an often unnecessary re-population of the properties object.
* the entity object of a storable no longer has a _key property - instead a cache entry now consists of an array containing the key and entity object. this is imho cleaner/more explicit than the previous approach.
* various store methods now take a storable as argument because they need to access a storable's key, entity and/or props property
* added lifecycle unit test
added test for internal storable properties (_key, _props, _entity)
modified property setter to *not* check if the value is different than the persisted one: if a mapped object cannot be resolved (eg. because the destination storable has been removed) _props contains a null value for the mapped property, although the persisted entity still contains the id, and this check prevents clearing the foreign id in the storable‘s record.
replaced StringBuffer with string concatenations where feasible, using StringBuilder for the rest (no thread safety needed when constructing queries)
query bugfixes:

* use alias of fromExpression if existing in selectShort parser rule. mysql requires the use of the table alias in select expressions if one is defined (eg.
   the query "from Author as author" must result in "select author.AUT_ID from T_AUTHOR", not "select T_AUTHOR.AUT_ID from T_AUTHOR")
* pass named parameter object to query select method in store.query()
fixed getEntity() to correctly populate the entity cache
modified collection instance creation

* pass the storable object to Collection.createInstance, instead of the entity object
* simplified createQueryParams()
check if debug logging is enabled before constructing log output
implemented simple query cache containing the parsed query ast trees
experimental: re-implemented caching of collections

* collections use a custom collectorgenerator/entitycollector, returning both an array of IDs and of storables (the latter only for aggressively loaded entities)
* note that only the ID-arrays are cached, the storables are created on-demand when accessing an index position of a collection (if the entity is not loaded aggressively)
* limitation: currently only the first entity of the query's from-clause is used
correct constructor property of storable instances, use it to access the mapping definition
correct constructor property of mapping constructors, use it instead of instanceof (micro tuning)
modified storable behaviour to avoid copying of primitive property values

the internal _props object now only contains modified primitive values and object/collection mappings. this way it's not necessary to copy all primitive values of a storable from its _entity to _props object when accessing a property for the first time (which can be quite expensive in both terms of performance and memory consumption).