Fix some spacing in javascript
Add design note for discovery doc in file.