Changed the Resource API to split out the open method into openRead and openWrite, as this better allows for more flexible resources in the future (they are not restricted to just files).