Fix for issue #669, making histogram alignment easier to control

Here is a simple attempt at fixing the bugs in the histogram aggregation method. 

Note this pull request solves two problems:

1. Erroneous results when data contains negative values.   As a result this will change existing behavior.
2. Adds control over bucket alignment.