Simplify patch from #50 to use `os.path.dirname`

@Tribex This should still work on Linux, see
http://labs.codecademy.com/BqV7/1#:workspace