Change PHP function to class 'Wot'

Refactored to OOP