fixed compile error when compiling only a partial library
implemented smarttpl compiler to convert .tpl into .so files
shared libraries can now be used as templates too
various performance optimizations