tests for script seeding.

add tests to script_test.rb
add unique, not-null constraints to Script.name column
some more refactoring