some additional cleanup and some further coding style fixes

Signed-off-by: Stefan Venz <ikstream86@gmail.com>
seperated functions to handle user input in input.c
and removed some debug printfs.
finished some TODOs and added some comments for better
readability of the code

Some new TODOs came up while finishing some of the old TODOs

Signed-off-by: Stefan Venz <ikstream86@gmail.com>