organized files into lib/ and spec/ and add testing