Dashboard module cleaning:
 * added apache licence preamble
 * refactoring
 * JSHint