Refactor JavaScript functions into more sensible locations.

NOTE: Gcc.removePrefixAndSuffix had no callers and was removed.

Change-Id: I9668ba213953698bc438ef3777cef77665a09072
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Use proper and consistent formatting in all JavaScript files.

Change-Id: I730e39070e2e93fea54e6a4fc52738c05f009e0e
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>