manage bans overhaul

small Refactoring for ManageBans
- methods visibility
- moved function to subs.
- moved db query to subs.
- removed some unused globals