Major modifications, separated out internal scripts to external files for inclusion.  Helps with update and other tasks.