made resource.rb and fragment.rb stand alone compatible. added validate resources