Cleanup: Avoid unnecessary irModule->functions.indexOf calls

With a growing number of functions per module, these calls become
expensive and are unnecessary. defineFunction in the code generator
can simply return the correct index right away.

Change-Id: I8ab56a3083bf215674a1b46c502b415be694e465
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Qml JavaScript code generation cleanups

* Run the binding expressions, functions and signal handlers through
  the V4 codegen _per_ component, and run the isel at the end for the
  entire file. We need to do per-component codegen because we want to
  set up the correct id and object scopes, which are different for the
  root component and anonymous components.
* Changed V4IR::Module to allow for the concept of "qml modules" where
  there is no root function defined. This is a logical consequence of
  running v4 codegen multiple times with different input but the same
  V4IR::Module.

Change-Id: Ib3a719f83507cbab7c2e4e145ccad5b663c795cf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>