resource-native: Add a lot of abstractions

Also uses those abstractions now in res_callback_func()