Add appdirs.user_config_dir support.

In the latest appdirs builds, `user_data_dir`` has moved from
~/.config/spartan to ~/.local/share/spartan. A `user_config_dir` command
was added for the original behavior (~/.config/spartan).

If the user is using the latest appdirs (v1.3.0 and up), then use
`user_config_dir`; otherwise, fall back on `user_data_dir`.
Fix getattr call to hasattr
Merge pull request #183 from rgardner/update-config-settings

Add appdirs.user_config_dir support.
Merge pull request #185 from rgardner/fix-config-settings

Use hasattr, not getattr in if statements
Merge pull request #182 from MaggieQi/master

add automatic tiling optimization
fix scan base array error