Javascript style checks

Signed-off-by: Tim Smart <tim.smart@designworks.co.nz>
Make example.js pass js checks

Signed-off-by: Tim Smart <tim.smart@designworks.co.nz>
Make lib pass js checks

Signed-off-by: Tim Smart <tim.smart@designworks.co.nz>