Refactor hot counter code a bit.
Refactor trace entering code and detect hot side traces.

Side traces don't work yet, so their flag defaults to off.
Be less chatty in debug level 2.
Implement basic setup for side traces.
Tiny bit of documentation.
Fix build on Linux.
Fix writing 32 bit immediates as 64 bit values.

On x64 there is no instruction for writing a 64 bit immediate directly
into memory.  We have to load it into a register first, this is what
we do most of the time on OS X since all addresses are at least 33
bits wide.

On Linux we can allocate below the 4G boundary and hence can use an
instruction that writes a 32 bit constant directly to memory.
However, the default operand width is 32 bits instead of 64 bits.
This patch fixes the encoding of this optimised instruction encoding
by making sure we actually write a 64 bit value to memory.
Allocate special closures on the static heap.

Special closures like the UPDATE and STOP closures so far were static
objects which confused the garbage collector.  Instead of adding
special cases to the GC, these closures are now allocated on the
static heap during initialisation.
Coloured and more complete loader debug output.
Store info tables in capability.

This is needed for future refactorings.  The `engine` function becomes
`engine_impl` and takes an operation mode.  The reason this is done
this way is because the interpreter uses direct threading and we can
only call these labels within this function.  So we need one mode,
where the engine operates as the interpreter as intended, and one mode
where it stores pointer to the dispatch tables in the capability.  No,
it's not pretty.
Fixes for building with non-default GHC.
Switch to new hot trace detection style.

Each non-local branch (CALL[T], EVAL, RET) now calls into a function
that determines whether trace recording should start at the target.

This also changes the policy of where traces may start. Until now we
had a counter for each branch target and thus a trace could start
anywhere. This has been changed so that only targets of a backwards
branch can start a trace (as any loop must contain such a branch).

Note that this still creates two traces for non tail recursive
functions.  For example,

    foo:  FUNC
          ...
      A:  r = CALL foo(x, y)
          ...
      B:  RET1 z

This will create a trace <foo-to-A> because the branch from A to foo
is a backwards branch (with increasing stack), and a trace <A-to-B>
because RET1 will branch to A (with decreasing stack).
Fix recorder/interpreter sign mismatch.

The trace recorder currently executes before the interpreter processes
these instructions. This to find out which way a branch goes it has to
evaluate the condition itself. This fixes a mismatch between the two
implementations.

We probably need a nicer way of detecting which way a branch goes.
For EVAL/CALL we need the target's info table, though, and for RETs we
need the return address.
Add side trace test case.
Add Googletest library; to be used by C++ port.
Start C++ port.
Make sure gtest is built before unit tests.
Start port of memory manager to C++.
Ignore unittest debug output.
Include autogenerated dependencies for C++ stuff.