Move module to own file in /lib and add spec