Add null check for rules in styles function

I had an issue similar to #7. When trying to save a Google Chart, I encountered the same error "Cannot read property 'length' of null", also in Chrome. Added a null check to prevent this from occurring.
Merge pull request #16 from trhall/gh-pages

Add null check for rules in styles function
Ignore styles on foreign hosts.

Fixes #17.

- Add test page stylesheet link to foreign host to test failure under Firefox.
- Refactor external URL check into isExternal function.
- Warn instead of throwing an error when trying to embed images from foreign hosts.
- Warn when trying to get styles from foreign hosts.
Merge branch 'gh-pages' of github.com:exupero/saveSvgAsPng into gh-pages
Fix isExternal logic.
Handle images that fail to load.
Fix xlink:href turned into href on images.
Update README.md
Add external hrefs to warn messages.
Only embed images in the SVG being exported.
Fix unclosed tags on test page.
Merge branch 'gh-pages' of github.com:exupero/saveSvgAsPng into gh-pages
Wrap scale factor in an options object.
Provide a hook for rewriting selector rules.

- Add a title.
- Add a test for CSS rules with selectors that require parents of the SVG node.
- Add support for a selectorRemap option that is used to change selector rules.
- Peel styles function to return only CSS. Leave insertion of defs node with CDATA up to svgAsDataUri function.
Merge remote branch 'upstream/gh-pages' into gh-pages