first attempt to reorganize code

all "static inline" have been removed to avoid warning when compiling.
add profiling file
minor edit
Merge branch 'code-reorganized'