Use named function literals, move export statements above function declaration

- I prefer `function name() {}` over `var name = functoin() {}`
- `module.exports = name; function name() {}` works. It's nice to keep the export declaration next to the function declaration