moved files into separate modules
moved files to separate modules
script can be invoked from an arbitrary directory