A general framework for analyzing beta diversity, nestedness and related community-level phenomena based on abundance data