Better ResourceDomain handling. Closes #66. Also added caves (not as smooth as desired, but functional). #65