Renamed constants.
Improved error handling in shortener.
Added javadoc.