Implemented & added tests for setting mode in metadata
Added documentation