Split script engine into multiple modules

It had gotten way too painful to add new features to the monolithic beast
that the poor script engine had turned into.