Made shellcraft more flexible and slightly less hackish (while fixing a bug in __dir__)