Added tests for abcd_normalize
See #1973.
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.
Fixed several corner cases