Test save_rules.

Added a testcase for save_rules() when operating on a directory
structure, this test checks if the files are written correctly.

Currently this test uses read_rules() to verify the written files, and
read_rules() currently sorts the rules before returning them, which
means that the test will successed even if the rules are not sorted
before writting them.
Fix bugs in save_rules() when working with directories

Fix bugs with save_rules() when working with directories as described in
issue #10 and tested in commit 6e8b4325d05ecd025f2d07d7bbd8f018fab8e343
Use sorted(rules) instead of rules.sort()
Small tweak to save/read_rules() docstrings.