Add init methods to javascript

Currently, we have old javascripts that automatically  get initialized when
the document is ready. This patch provides a mechanism to access those
initialization code by assigning them a name.

Change-Id: I59aa4abf6c68675f7c5f2802682d73fb7beb7613
Closes-bug: #1347072
Merge "Add init methods to javascript"