Fix bug where we MUL instead of AND
Refactor obscure data table to register offset table