Added some utility methods to moonshine.

See commits for comments.