Algorithm complete

Transfered code from test to algorithm.js
Added Natural Docs style commenting to algorithTest.html and
algorithm.js