fixed a very very large amount of problems and changed a lot, version changed to 4, consider the project to be mainly stable from now on.

Signed-off-by: mep <miethpo@gmail.com>