Fix "implements in RHS file"

Recent CL broke run-bindings-tests on my machine:
Move modules-dependent IDL statements out of core by supporting 'implements' in RHS interface
https://codereview.chromium.org/270573005/

This is due to depending on order of files;
this is fixed by doing the moving/merging in a separate, global phase
(which we're already doing).

Also:
* Adds a test case.
* Fixes unaddressed nits.

R=haraken
BUG=358074

Review URL: https://codereview.chromium.org/270823002

git-svn-id: svn://svn.chromium.org/blink/trunk@173613 bbb929c8-8fbe-4397-9dbb-9b2b20218538