Add more externs and type annotations

for Closure Compiler.