Improved ident method and added jsdoc to utils.

- Broke out utility methods into function declarations.
- Added jsdoc annotations to the aforementioned methods.
- Improved the indent method to handle arbitrary identation strings
  including tab characters.