Added mg_get_var() to core, with unit test
tests moved under build