Adding tests to line container and refactoring Line