Add more tests

Some of these are based on https://gist.github.com/mathiasbynens/6334847.