Implement reload on script change; add some missing unit tests.