formatting updates, js updtes, and wording

added proper php closing to testing templetes and fixed some namespace
naming errors.

added default case to js

changed some of the sampling wording around