Added array root element support

Applied a patch (including test cases) to add support for array root elements (as per issue #27)