refactored code

replaced error message class with error constants
refactored shortned urls to not be dependent on the current domain
urlshortener is now initialized with a hash of url data
urlshortener instances no longer contain the stats

Signed-off-by: Bebe Peng <bebepeng@gmail.com>