Split elseif statements, add tests