Updated exportCategories.php

fixed recursion and split code up into seperate methods.
original output was 
* Default Category (1328 products)
* Default Category (1328 products)
  * Unitards (99 products)
  * Tops (78 products)
  * Pants (17 products)
  * Briefs (6 products)
  * Dresses (37 products)
  * Skirts (22 products)
  * Costumes (480 products)
  * Teamwear (28 products)
  * Accessories (64 products)
  * Fabric Sales (74 products)
  * Customer Service (0 products)
  * Specials (37 products)
  * Clearance (74 products)


New output

* Default Category (1328 products)
  * Leotards (81 products)
    * All Leotards (66 products)
    * Build Your Own- You Choose The Front (15 products)
  * Unitards (99 products)
    * Halter, Cami, Tarzan, & Open Or Strappy Backs-all (48 products)
      * Biketards (0 products)
    * Biketards (51 products)
      * Halter, Cami, Tarzan, & Open Or Strappy Backs-all (51 products)
  * Tops (78 products)
    * Tops - All (70 products)
    * Men's Tops - Looser Around Waist (8 products)
  * Pants (17 products)
    * Jazz & Boot Pants & Chaps (17 products)
  * Briefs (6 products)
  * Dresses (37 products)
    * A-line Dresses (8 products)
    * Mock Neck Skating Dresses (8 products)
    * Non-mock Neck Skating Dresses (15 products)
    * Mock Neck Dresses (2 products)
    * Non-mock Dresses (4 products)
  * Tights (21 products)
    * Ankle Leggings (21 products)
  * Skirts (22 products)
    * A-line (22 products)
  * Costumes (480 products)
    * Characters, Themes, Animal-previous (42 products)
    * Previous Costumes (178 products)
    * Lyrical Previous Costumes (84 products)
    * 2014-2015 Catalog 65% Done (176 products)
  * Teamwear (28 products)
    * Previous Ideas (21 products)
    * 2010-2011 Teamwear (7 products)
  * Accessories (64 products)
    * Hair Products, Eyelashes (10 products)
    * Mitts, Gloves, Add-a-sleeve (32 products)
    * Belts (3 products)
    * Boots & Hosiery (3 products)
    * Jewelry, Flower Pins, Brooches (9 products)
    * Tutu's (2 products)
    * Alteration (5 products)
      * Shipping Fees (5 products)
    * Shipping Fees (0 products)
  * Fabric Sales (74 products)
    * Stretch Fabrics (45 products)
    * Appliques & Trims & Beaded Fringe (29 products)
  * Customer Service (0 products)
  * Specials (37 products)
    * Pageants (37 products)
  * Clearance (74 products)
    * Tops (11 products)
    * Skirts (2 products)
    * Costumes - Discounted Pricing (47 products)
    * Unitards (2 products)
    * Exclusive Costumes (13 products)