Renamed stack.js to index.js
Changed main and added test script
Added tests
Simplified main