Bitmask visualization in Javascript