Category model

includes category tree and minor refactoring