MVC + is_dir

The add/edit view now uses variables passed by the controller (instead of using the $controller variable). The controller also checks if the optional templates directory inside the blocks folder exists before trying to read from it.