Some refactoring, fixed post-registration /nick bug and added hostname logic...