IP address parser and whatnot for javascript