New method and some javascript tweaks

- Some code changes in order to make javascript more compliant with good
practices
- Added a method that extract the methods data as an object with the id
as the key (can be used to as a shortcut to make the data firebase
compliant)