fixed bug in CTD writer (failed to add attributes and restrictions to lists)

 * fixed some sonar issues
 * extended tests for CTD readers and writers