0527 common

Repack common budget calculator and query. plus minor fix for #256. 
DataType.java is deleted since it's not used. let me know if you like where I  put those classes. Thanks.