Started allowing for a more multithreaded database approach.
Optimised out some unnecessary memory allocations, and packet length checks are now more appropriate for each socket (ideally shouldn't need to allocate mem per socket for it, but it's good for now).
Taking it out of the header + small cleanup