Implemented constructor, valid function, and allocator function: fixes #11, fixes #15