Use destroy instead of clear. fixes #5
Add unittest for JSONName including style fix