Various optimizations.
- Declare small functions as "inline" and move to header files.
- Remove logging functions if corresponding loglevel is disabled at compile time.
Merge pull request #56 from fancycode/inline_optimizations

Various optimizations.