I have been searhcing but could not find anything about this. How would I programmatically do the "Move/ Link To Folder" that is available in the commerce manager's catalog management
We use ILinksRepository (which implements IRelationRepository and IAssociationRepository) and to manage the relations/associations. You can use it to handle the relations between your entry and the category.
Here's the documentation with code samples.