Add directory code

- Remove pyc files
Refactor tests to use tempfile for files