Local variables are now tracked by descriptors

Use LocalDescriptor instead of an index to track local variables. This
makes optimisation easier. Also added an unfinished local scope
peephole optimiser.