Fix hoisting of let/const declarations.

Only hoist top-level let/const declarations and fix bug with
initializers of hoisted declarations.

Fixes #1028.
FYI, this could also have been done with setup and teardown functions.