Added browser support and fixed some small JS issues.