renamed files
made c++ classes
implemented version, which uses plane-per-plane processing
removed some heap memory and replaced it by stack memory
fixed some memory leaks