Refactors the functions used in agnhost into different modules, based on their functionality, leaving only the main in the base folder. Future commits will add several functionalities to agnhost, so this change will be necessary to keep it clean.