added base_dir option
cleanup
Merge pull request #1 from xaicron/master

Added base_dir option and cleanup codes