Add basic test suite
Simplify Sample helper definition
Remove unused items variable
Add simple profiler
Elimenate Kernel#nil? calls

Low hanging fruit to speed up Estimator#query by 17%.
Fix NilComparison exception

In case #query got called before the first observation, it changed the
state of @head which later led to a NilComparison error (@buffer.shift
== nil -> @head.value == nil).

This change short circuits #flush and prevents any state changes caused
by #query.