Moved some methods that were on the prototype to be static, part of response to code review, see #3.