Why did you remove the package structure? It's a very good practice to put every class inside a package. The only exceptions I make are small classes that I mostly use for quickly testing something and discard within an hour or so.
Most of the errors are going to be telling you about lines of code which should be inside a class. Which is every single line of code which you posted there. If you'll remember back to when you were learning basic Java, you should remember that a Java class starts with code looking something like this:
And yes, servlets are required to be in a package. But the package declaration isn't the source of your error messages.