Fix for bug #3599: cv::FileStorage does not work for std::vector of user-defined struct.
WriteStructContext treats state of fs
Added test code for I/O of user-defined types.
corrected some style errors found by review.
Merge pull request #2476 from minkless:3.0-bugfix-core-filestorage