Refactors and namespaces javascript code by page; does this for Friends#Index and Cliques#New