Rafactors out src and prepares passing unit tests