Setters and getters

Based on initial effort in #25 by @vekexasia. Closes #4.