make it a proper package
Tests and corrections
      Attribute processing as a separate function
      Added tests
      Added fields to generate-index