Added a resource manager.

Still under construction (some resource types are not implemented still),
look at the test application for more information.