Fix testcase to actually emit d.ts file
Regression tests
Tests for new LS bugs
Fix bugs related to declaration emitting:
1. Traverse only elements we are interested in
2. Emit global ambient declarations in the declare file.