Add some tests.

I had to put the process.browser thing into module.exports to be able to test it. Hopefully thats okay.