Add intellij project for easy compilation and refactor to extract
CopyOnWrite class.