Implement tests for resource management

Issue #64