More refactoring and using bitmaps
Merge branch 'stage1' of https://github.com/Isanderthul/paperbandit into stage1