Cleaned up 051.hs a bit. It now generates (core,mask) pairs recursively, which is easier to get exactly correct.