Implemented resource manager. Closes #121.