Change singleton functions completely.
Added singleton test
Added singleton class and tests.