Refactor javascript to use onle one global variable

call methods from the namespace RP
add compiled folder to .gitignore