Proper build process, add shell scripts, fix tests