Split into core script and extensions.

None of the extensions are actually required for writing unit tests.