pulling out more reusable functionality and sticking it in lib/bsv.  Also adding a new benchmark