Clean up project code and optimise performance
This request improved various things:
- Removed various global variables.
- Removed database wrappers.
- Optimised database access and size.
- Implemented signal handler for clean shutdown.
- Corrected module name.
Signed-off-by: Ophestra Umiker cat@ophivana.moe