Added shape mismatch checks
Rewritten function abcd_normalize, closes #1973
Code is notably simplified, at the cost of not showing specific
error messages for each shape mismatch. That is easy to fix, but
I wanted to leave this state here.