resources: code refactors and documentation improvements in preparation of better schema support and support for "external" packages. still not in working order.