Made stack into a facade for JS arrays. Added tests for it.