Implements representation conversion using to/as. Closes #3.