I'll have to get back with you on the rest of this because I have to leave in a minute but the code for username_check isn't to replace the method in the library or model but to use as a form_validation callback in the controller. Don't change the library or model!
I'll get back to you on the rest of it soon or maybe someone else can in the mean time.