Now the code is more organized and functional

* Fixed some serious security issues
* Fixed the annoying bug with linebreaks
* Added DEBUG mode (not fully working)
* Rearranged and shrunk some code
* Added some comments