Reimplemented query of custom inherited user resources through attributes (linq). Plus some fixes and refactoring. Sorry for the large commit