Some refactors: Scopes delimitation of functions and vars. Remove unused vars. Comment uncommented methods
Remove some not used and empty methods.
Unnused params, some TODO tasks.
Suported as AMD module