Limit element depth
Trivial bugfix in the links rule
Move link helpers to it's own file

+ return value of parseLink* functions in the state