Refactoring of parser functions complete. Decode with autodetection vastly improved.