Auto generate unique product code if not provided

http://manage.dimagi.com/default.asp?121783
i recognize this was just a moved function but it would still be awesome to see some (non-db!) tests for it.