Partial rewrite
Tests added
AngularJS sample added