Added setup script, unit tests; cleaned up