Fixed directory encoding, cleanup, formatting

-Fixed issue with directory printing out in a wonky way--was encoded as
Unicode. Switched to default encoding.
-Cleaned up some unused code, comments.
-Made some formatting more consistent and uniform.