Fix words going out of bound by using when adding words to the line

This approach uses a simple for-loop instead of iterators because it is
expected that the index gets decremented if the word will go out of the
border. Thus, the method that checks and adds the word if it will not go out
of bound is changed to a method that simply checks whether adding the word
will be within the border or not.
Change LayoutManager of classes so that lines and words are spaced correctly

BoxLayout is used for the TypePanel because it is required for this class to
align vertically. FlowLayout is used for the Line and Word class.
Fix spacing issue when space is added
Reset more variables in the restart() method

Although the clear() method is called in the loadLinesAndAddToPanel method, it
is cleared in the restart() method anyway.