Updated to work properly with msvc2013
use type traits for kernel argument setting
added license information to every file