script: Add a function to check whether a node is before another one … …
…in DOM order. Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>