Add support for plugins in login server

Move packet handlers to functions.
Add interface in login.c
Updated HPM hooks.