Move code out, that handles the actual structure to be used for the decoded
data. Will make it easier to add different structures
Merge branch 'PHP-5.6'