add scalatest for easier unit testing
Properly handle sign extension for all int variants