Merge pull request #70 from TheUnknownOne/design

Reduce db weight
add tests and fix toNum