Fixed whitespacing and some XeTeX logic. Re-added showkeys with the [final] option tag to suppress output, but this needs to be hooked into something more user-friendly in time.