Refine and Reformat code

- Use 4 spaces instead of tabs
- Check code by jshint