Factorization based on grammar

Rules for factorization added. Link to grammar -
http://en.wikipedia.org/wiki/Uniform_resource_locator