Use proper typedef for Weights
Use shared_ptr for storing tracks.

Significantly reduces memory usage.
Use thread_specific_ptr for Lua.

Fixes #67.
Merge pull request #74 from petersohn/master

Improvements