bf.nim: replaced with a better and more idiomatic version
bf.nim: replaced with a better and more idiomatic version

This version is based on the C++ version, with adjustments to make
better use of Nim's type system.

Some notable changes compared to the original are:
- No more StringIterator object, instead a closure iterator is used.
  This helps reduce the amount of memory needed (the input string
  doesn't have to be duplicated into an object).
- Op is now an object variant. This allows the compiler to enforce
  access rules depending on the OpType enum on compile time. Does not
  affect performance at all.
- func is used in place of proc. This is short for proc {.noSideEffects.},
  which let the compiler enforces that the function won't change any
  state not reachable by it's parameter. Does not affect performance.
- move now doubles the seq size instead of extending the seq one-by-one
  until it's big enough. Greatly improves performance. (Copied from the
  C++ version).

With all the changes in place, the numbers on my machine are:

       Time (bench.b)   Memory (bench.b)   Time (mandel.b)   Memory(mandel.b)
-----|----------------|------------------|-----------------|------------------|
 Old        2.35              1.6               27.53              3.1
-----|----------------|------------------|-----------------|------------------|
 New        1.77              0.8               25.66              2.1

kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks,kostya/benchmarks