fix typo in externs
move and update build scripts