Addressing Issue #51 & Issue #52

1. Adds attributes to non-leaf elements.
2. Elements with the same name will now be in a proper numerically indexed array rather than having the first element having its child elements as non-numeric keys.
This is the only piece I'm not sure I have addressed correctly. I haven't found a condition where this happens to understand what, if anything, should be done to ensure the result is only a numerically indexed array containing all the data for the elements of the same name.