Fix a lot of problems in the parse function

Since it's confusing dealing with both `advanced` and... let's say `traditional` links, I've split the handling of each into separate functions. Also there's a lot of other little changes. 
This never made sense. At this point, we should have exited the function if we weren't using advanced. Anyway, now it's out.