Null parent fix
Type fix, half of mysql refactor to seperate files
Finished refactoring MySQL DB files
Small fixes, added types in group query