Mask Refactorings

Addresses #67 and #51