Convert prototype methods to constructor to fix 0.11