Update parser.js

Restored parseUseDirectives functionality, maintaining getElementsByTagName and  changing logic of running trought the list.