Refactor compile.sh, add some notes to TODO