Added and improved tests, also fixed some bugs from after the V8 upgrade