modsstruct: Replace some asserts with exceptions.
modsstruct: Implement sizeof() for PTR and ARRAY.