Allow metadata function to accept a string as a parameter

Add all tests unit test
Woot for tests