Split SDM's JavaScript into a lib that can be tested.

Change-Id: I11b7821871fbd626a579d4dba9b5f9a312f537ca
9 files changed