Changes functions to static inner classes and adds initial tests