DM Inverse queries

Clean up code
Changed name from ExerciseDatabase to ExercisePool
Added support from categories and automatic category detection