Explicitly declared testDiv as a global variables

For sanity reasons
Made the thing D3-ish

Using D3 selections, not DOM selection. Keeps one saner.