Fixes ignoring of XFilesFactor

The XFilesFactor that was being passed to the create method
was being ignored previously.  Now it isn't.

Signed-off-by: ciaranj <ciaranj@gmail.com>
Fixes updateMany so it now, err, updates many!

Previously calls to updateMany would ultimately have their
data discarded, as concat does not mutate the existing
arrays but returns a new one, the python-ported algorithm
doesn't quite apply.

Signed-off-by: ciaranj <ciaranj@gmail.com>
unixTime() will now round up, rather than down.

This change may be un-acceptable :(.  If Hoard.js is used within the same
process as statsd (as for example a back-end) then it is possible that hoard
will refuse updates from statsD's flush event as the timestamp that
statsd generates will appear to be from the future.

This is because Hoard.js was using:

  parseInt( new Date().getTime() / 1000 )

But statsd is using :

  Math.round( new Date().getTime() / 1000 )

To get their idea of 'now'.  Most of the time this will be ok, but if
a the result of the division contains a fractional part greater than or
equal to .5 then statsd will round-up to the next nearest integer value
but Hoard was truncating (discarding?) the fractional part, meaning
it would be (as far as it was concerned) timestamps from the future
when update was called sufficiently quickly after the flush.

Signed-off-by: ciaranj <ciaranj@gmail.com>
Adds configurable aggregationType support

Much like commit 0cc664 in the python whisper project,
this commit introduces support for specifying the aggregation type
(one of 'sum', 'max', 'min', 'last' or 'average') when propagating
values into the lower precision archives.

This commit also bumps the package number as it introduces a breaking
change to the create interface by making the xFilesFactor and new
aggregationMethod arguments optional (defaulting to 0.5 and average
respectively). Following semver.org recommendations that means a bump
to the middle value :)

Signed-off-by: ciaranj <ciaranj@gmail.com>
Add in required assert module

Signed-off-by: ciaranj <ciaranj@gmail.com>
Adds prepublish script to generate JS from coffeescript
fix create: don't overwrite existing file