Generalization

Generalized the "dirs" and "clear" targets. mkdir and rm have been
implemented in a Python script to enhance platform-independency.