javascript: factor AST into own module
javascript: whitespace
javascript: wrap exceptions in function