Added some tests, factored out the scatter functions out of the main file. Renamed files to achieve that.