Code clean up
Fixed tests. Removed old obsolete scripts