Rearranged to have the model be more independent. Added possibility to publish to Bintray.