Small tweaks to improve the codebase.

- Migrated the bower install to a before_script.
- Fixed the regular expression to correct match the last return.
- Updated the define to not be a simplified CommonJS function.