Added hierarchy support and unit test for loading hierarchy