keenlabs/keen-gem — pull request #13 by mtparet (2013-06-11 13:58:02+00:00)
Title: [Feature] Managing saved queries

### Overview

With the current state of the keen-gem, this is not possible to manage saved queries.
To achieve this we need an object to represent a query, to access to the settings outside of the client class and share helpers methods.

These modifications should not change any current behaviors

### Managing saved queries

Managing saved queries require MASTER_ID.

To save a query like this one:

```ruby
Keen.sum("purchases", :target_property => "price")
```
You need to pass the name of query as the first parameter to the Keen::Query initializer and call the save method on this query:
```ruby
Keen::Query.new('sum','purchases', :target_property => "price").save('name_of_the_query')
```

To executed a saved query:

```ruby
Keen::Query.execute('name_saved_query')
```

Create a query:
```ruby
query = Keen::Query.new(query_name, event_collection, params)
```

Execute the query:
```ruby
query.execute
```

Save the query:
```ruby
query.save('name')
```

Delete a query
```ruby
Keen::Query.delete('name_saved_query')
```

### Other changes

The config variables are now stored in a Config class.
Helpers methods moved to helpers file.