Custom metadata

Implementation of the functionality described in #252 

Tests:
* Unit test: 100% pass
* Harness: 100% pass
* Valgrind: 100% pass

This PR wont't include "post-LGTM indentation fixing commit".