More core refactoring, read and write funcs use more reliable access
Code refactoring and even better port organization
Added CFG_DBG_ENABLE option
Moved some warnings into errors