Refactor layout_perl a bit. Supports nested dirs now.