shortening links through js

Still needs some caching from @teodorescuserban :)