Support for postgresql

I think it was the last request using 'end' missing the postgresql support.
Revert "fix npe in topNBinaryFn with post aggs"

This reverts commit bbedde3418ba0a83a1777681d549b3ff1295b000.
calculate postAggs while pulling from cache
fix more issues and add test

1) Add test for caching and calculation of dependent post-aggs for
TimeSeries and TopN
2) Fix more NPEs while calculating dependent postAggs, passing
baseHolder was wrong as it does not contain post-aggs during computing
dependent ones.
add test + small fix for other test
handle NaN / Infinity values
Add diff values, to test another path in merging
Merge pull request #498 from metamx/fix-nan-serde

handle NaN / Infinity values
Merge pull request #466 from Crystark/patch-1

Support for postgresql
Merge pull request #499 from metamx/fix-pull-from-cache

Fix pull from cache
update emitter version